<extend name="Public/common" />
<block name="body">
<div class="page">
  <div class="fixed-bar">
<include file="Public:adminmenu" />
  </div>
  <div class="fixed-empty"></div>
  <form id="form1" method="post" name="form1">
    <input type="hidden" name="admin_id" value="{$info['admin_id']}" />
    <table class="table tb-type2">
      <tbody>
        <tr class="noborder">
          <td colspan="2" class="required"><label>登录名:</label></td>
        </tr>
        <tr class="noborder">
          <td class="vatop rowform">{$info['user_name']}</td>
          <td class="vatop tips"></td>
        </tr>
        <tr>
          <td colspan="2" class="required"><label class="validation" for="real_name">姓名:</label></td>
        </tr>
        <tr class="noborder">
          <td class="vatop rowform"><input type="text" value="{$info['real_name']}" name="real_name" id="real_name" class="txt"></td>
          <td class="vatop tips">姓名或者昵称</td>
        </tr>
        <tr>
          <td colspan="2" class="required"><label for="password">密码:</label></td>
        </tr>
        <tr class="noborder">
          <td class="vatop rowform"><input id="password" name="password" class="txt" type="password"></td>
           <td class="vatop tips">不修改留空即可</td>
        </tr>
        <tr>
          <td colspan="2" class="required"><labe for="confirm_password">确认密码:</label></td>
        </tr>
        <tr class="noborder">
          <td class="vatop rowform"><input id="confirm_password" name="confirm_password" class="txt" type="password"></td>
          <td class="vatop tips"></td>
        </tr>
        <tr>
          <td colspan="2" class="required"><label class="validation" for="group_id">权限组:</label></td>
        </tr>
        <tr class="noborder">
          <td class="vatop rowform">
          <select name="group_id">
          <volist name="group" id="vo">
          <option <eq name="info.group_id" value="$key">selected</eq> value="{$key}">{$vo}</option>
          </volist>
          </select>
          </td>
          <td class="vatop tips">请选择一个权限组，如果还未设置，请马上设置</td>
        </tr>   
      </tbody>
      <tfoot>
        <tr class="tfoot">
          <td colspan="15" ><a href="JavaScript:void(0);" class="btn" id="submit"><span>提交</span></a></td>
        </tr>
      </tfoot>
    </table>
  </form>
</div>
<script>
$(function(){$("#submit").click(function(){
    if($("#form1").valid()){
     $("#form1").submit();
	}
	});
});
$(document).ready(function(){
	$("#form1").validate({
		errorPlacement: function(error, element){
			error.appendTo(element.parent().parent().prev().find('td:first'));
        },
        rules : {
        	real_name : {
                required : true
            },
        	password : {
				minlength: 6,
				maxlength: 20
            },
            confirm_password : {
				minlength: 6,
				maxlength: 20,
				equalTo: '#password'
            },
            group_id : {
                required : true
            }
        },
        messages : {
        	real_name : {
                required : '姓名或者昵称必须填写'
            },
            password : {
				minlength: '密码长度为6-20',
				maxlength: '密码长度为6-20'
            },
            confirm_password : {
				minlength: '密码长度为6-20',
				maxlength: '密码长度为6-20',
				equalTo:   '确认密码与密码不匹配'
            },
            group_id : {
                required : '请选择一个权限组',
            }
        }
	});
});
</script>
</block>